/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sunsite.dao;

import org.springframework.dao.DataAccessException;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import sunsite.po.Visit;

/**
 *
 * @author mg
 */
public class VisitDaoImpl extends HibernateDaoSupport implements VisitDao{

    public void createVisit(Visit visit) throws DataAccessException {
         getHibernateTemplate().save(visit);
    }

    public void updateVisit(Visit visit) throws DataAccessException {
        Visit updated = (Visit) getHibernateTemplate().get(Visit.class, visit.getVisitId());
        updated.setIslogin(1);
        updated.setVisitTime(new java.util.Date());
        getHibernateTemplate().update(updated);
    }


}
